package com.mazaiting.websocket.controller;

import com.mazaiting.common.core.domain.result.Result;
import com.mazaiting.websocket.service.TestService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 测试控制器, 向网页推送数据
 */
@RestController
@RequestMapping("/api/test")
public class TestController {

    /**
     * 测试服务
     */
    @Resource
    private TestService testServiceImpl;

    /**
     * 推送消息到网页
     * @return 结果
     */
    @PostMapping("/pushToWeb")
    public Result<?> pushToWeb() {
        testServiceImpl.printTime();
        return Result.success();
    }

}